package demo;

class MyArrays{
    public Object[] arr = new Object[10];

    public Object getArray(int pos) {
        return this.arr[pos];
    }

    public void setArray(int pos, Object x){
        this.arr[pos] = x;

    }
}


public class Text {

    public static void main(String[] args){
        MyArrays arrays = new MyArrays();
        arrays.setArray(0,11);
        arrays.setArray(1,"sda");
        int ret = (int)arrays.getArray(0);//虽然Object可以存放任何类型  但是其他类型转Object需要强转

    }

    public static void main1(String[] args) {
        Integer a = 10;
        int i = a;  //拆箱

        int ii = 10;
        Integer aa = ii; //装箱

        Integer a1 = 10;
        Integer a2 = 10;
        Integer a3 = 200;
        Integer a4 = 200;
        System.out.println(a1 == a2);
        System.out.println(a3 == a4);

    }
}
